<!-- HTML header for doxygen 1.11.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: Emoji support</title>
<link rel="icon" href="doxygen.ico" type="image/x-icon" />
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_manual.css" rel="stylesheet" type="text/css"/>
<link href="extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><a href="../index.html"><img alt="Logo" src="doxygen_logo.svg" height="35px"/></a></td>
  <td class="menu-item"><a href="index.html">Docs</a></td>
  <td class="menu-item"><a href="changelog.html">Changelog</a></td>
  <td class="menu-item"><a href="../helpers.html">Extensions</a></td>
  <td class="menu-item"><a href="../examples.html">Examples</a></td>
  <td class="menu-spacer">&#160;</td>
  <td class="menu-item" id="download">
      <img class="download-icon" src="../assets/download.svg" width="16px" height="16px" alt="Download doxygen"/>
      <a href="../download.html">Download</a>
  </td>
  <td class="menu-item" id="donate">
     <form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="nav-item d-inline-flex px-1 mx-1">
       <input type="hidden" name="cmd" value="_donations" />
       <input type="hidden" value="doxygen@gmail.com" name="business" />
       <input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHosted" />
       <input type="hidden" name="lc" value="US" />
       <input type="hidden" name="tax" value="0" />
       <input type="hidden" name="item_name" value="Doxygen donation" />
       <input type="hidden" name="no_shipping" value="1" />
       <table class="donate">
         <tr>
           <td class="donate-button"><input type="image" width="74" height="21"
               src="https://www.paypal.com/en_GB/i/btn/btn_donate_SM.gif" border="0" name="submit"
               alt="Donate to Doxygen with PayPal!" /></td>
         </tr>
         <tr>
           <td class="currency"><select size="1" name="currency_code">
               <option selected="selected" value="EUR">&euro; (EUR)</option>
               <option value="USD">$ (USD)</option>
             </select></td>
         </tr>
       </table>
     </form>
   </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
     <div id="nav-tree-ads-carbon">
       <script async type="text/javascript" src="https://cdn.carbonads.com/carbon.js?serve=CK7DTK3M&placement=stacknl" id="_carbonads_js"></script>
     </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('emojisup.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<div><div class="header">
  <div class="headertitle"><div class="title">Emoji support</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The <a href="http://www.unicode.org/">Unicode consortium</a> has defined a set of <a href="https://en.wikipedia.org/wiki/Emoji">emoji</a> with the corresponding Unicode sequences. Doxygen supports the subset of emoji characters as used by GitHub (based on the list <a href="https://api.github.com/emojis">https://api.github.com/emojis</a>). An emoji is created using the <a class="el" href="commands.html#cmdemoji">\emoji</a> command. For example <code>\emoji smile</code> or <code>\emoji :smile:</code> both produce <span class="emoji">&#x1f604;</span>.</p>
<h1><a class="anchor" id="emojirep"></a>
Representation</h1>
<p>For the different doxygen output types there is an output defined:</p><ul>
<li>Unicode code sequence, the actual representation is depending on the possibilities of the fonts loaded:<ul>
<li>HTML</li>
<li>DocBook</li>
<li>RTF, converted to UTF-16 representation.</li>
</ul>
</li>
<li>Image<ul>
<li><img class="formulaInl" alt="{\LaTeX}" src="form_0.png" width="34" height="13"/> , in case the image can be found (see <a class="el" href="emojisup.html#emojiimage">Emoji image retrieval</a>) otherwise the plain emoji text (i.e. <code>:&lt;text&gt;:</code>) is displayed</li>
</ul>
</li>
<li>plain emoji text (i.e. <code>:&lt;text&gt;:</code>)<ul>
<li>man</li>
<li>perl</li>
</ul>
</li>
<li>For XML there is a dedicated <code>&lt;emoji&gt;</code> tag with <code>name</code> and <code>unicode</code> attributes.</li>
</ul>
<h1><a class="anchor" id="emojiimage"></a>
Emoji image retrieval</h1>
<p>In the list of images can be downloaded via the following Python script: </p><div class="fragment"><div class="line"><span class="comment"># script to download the emoticons from GitHub and to produce a table for</span></div>
<div class="line"><span class="comment"># inclusion in doxygen. Works with python 2.7+ and python 3.x</span></div>
<div class="line"><span class="keyword">import</span> json</div>
<div class="line"><span class="keyword">import</span> os</div>
<div class="line"><span class="keyword">import</span> argparse</div>
<div class="line"><span class="keyword">import</span> re</div>
<div class="line"><span class="keywordflow">try</span>:</div>
<div class="line">    <span class="keyword">import</span> urllib.request <span class="keyword">as</span> urlrequest</div>
<div class="line"><span class="keywordflow">except</span> ImportError:</div>
<div class="line">    <span class="keyword">import</span> urllib <span class="keyword">as</span> urlrequest</div>
<div class="line"> </div>
<div class="line">unicode_re = re.compile(<span class="stringliteral">r&#39;.*?/unicode/(.*?).png\?.*&#39;</span>)</div>
<div class="line"> </div>
<div class="line"><span class="keyword">def </span>get_emojis():</div>
<div class="line">    response  = urlrequest.urlopen(<span class="stringliteral">&#39;https://api.github.com/emojis&#39;</span>)</div>
<div class="line">    raw_data  = response.read()</div>
<div class="line">    <span class="keywordflow">return</span> json.loads(raw_data)</div>
<div class="line"> </div>
<div class="line"><span class="keyword">def </span>download_images(dir_name):</div>
<div class="line">    <span class="keywordflow">if</span> <span class="keywordflow">not</span> os.path.exists(dir_name):</div>
<div class="line">        os.makedirs(dir_name)</div>
<div class="line">    json_data = get_emojis()</div>
<div class="line">    num_items = len(json_data)</div>
<div class="line">    cur_item=0</div>
<div class="line">    <span class="keywordflow">for</span> image,url <span class="keywordflow">in</span> sorted(json_data.items()):</div>
<div class="line">        image_name = image+<span class="stringliteral">&#39;.png&#39;</span></div>
<div class="line">        cur_item=cur_item+1</div>
<div class="line">        <span class="keywordflow">if</span> url.find(<span class="stringliteral">&#39;/unicode/&#39;</span>)==-1 <span class="keywordflow">or</span> <span class="keywordflow">not</span> os.path.isfile(dir_name+<span class="stringliteral">&#39;/&#39;</span>+image_name):</div>
<div class="line">            <span class="keyword">with</span> open(dir_name+<span class="stringliteral">&#39;/&#39;</span>+image_name,<span class="stringliteral">&#39;wb&#39;</span>) <span class="keyword">as</span> file:</div>
<div class="line">                print(<span class="stringliteral">&#39;%s/%s: fetching %s&#39;</span> % (cur_item,num_items,image_name))</div>
<div class="line">                file.write(urlrequest.urlopen(url).read())</div>
<div class="line">        <span class="keywordflow">else</span>:</div>
<div class="line">            print(<span class="stringliteral">&#39;%s/%s: skipping %s&#39;</span> % (cur_item,num_items,image_name))</div>
<div class="line"> </div>
<div class="line"><span class="keyword">def </span>produce_table():</div>
<div class="line">    json_data = get_emojis()</div>
<div class="line">    lines = []</div>
<div class="line">    <span class="keywordflow">for</span> image,url <span class="keywordflow">in</span> sorted(json_data.items()):</div>
<div class="line">        match = unicode_re.match(url)</div>
<div class="line">        <span class="keywordflow">if</span> match:</div>
<div class="line">            unicodes = match.group(1).split(<span class="stringliteral">&#39;-&#39;</span>)</div>
<div class="line">            unicodes_html = <span class="stringliteral">&#39;&#39;</span>.join([<span class="stringliteral">&quot;&amp;#x&quot;</span>+x+<span class="stringliteral">&quot;;&quot;</span> <span class="keywordflow">for</span> x <span class="keywordflow">in</span> unicodes])</div>
<div class="line">            image_str = <span class="stringliteral">&quot;\&quot;:&quot;</span>+image+<span class="stringliteral">&quot;:\&quot;,&quot;</span></div>
<div class="line">            unicode_str = <span class="stringliteral">&quot;\&quot;&quot;</span>+unicodes_html+<span class="stringliteral">&quot;\&quot;&quot;</span></div>
<div class="line">            lines.append(<span class="stringliteral">&#39;  { %-42s %-38s }&#39;</span> % (image_str,unicode_str))</div>
<div class="line">    out_str = <span class="stringliteral">&#39;,\n&#39;</span>.join(lines)</div>
<div class="line">    print(<span class="stringliteral">&quot;{&quot;</span>)</div>
<div class="line">    print(out_str)</div>
<div class="line">    print(<span class="stringliteral">&quot;};&quot;</span>)</div>
<div class="line"> </div>
<div class="line"><span class="keywordflow">if</span> __name__==<span class="stringliteral">&quot;__main__&quot;</span>:</div>
<div class="line">    parser = argparse.ArgumentParser()</div>
<div class="line">    group = parser.add_mutually_exclusive_group()</div>
<div class="line">    group.add_argument(<span class="stringliteral">&#39;-d&#39;</span>,<span class="stringliteral">&#39;--dir&#39;</span>,help=<span class="stringliteral">&#39;directory to place images in&#39;</span>)</div>
<div class="line">    group.add_argument(<span class="stringliteral">&#39;-t&#39;</span>,<span class="stringliteral">&#39;--table&#39;</span>,help=<span class="stringliteral">&#39;generate code fragment&#39;</span>,action=<span class="stringliteral">&#39;store_true&#39;</span>)</div>
<div class="line">    args = parser.parse_args()</div>
<div class="line">    <span class="keywordflow">if</span> args.table:</div>
<div class="line">        produce_table()</div>
<div class="line">    <span class="keywordflow">else</span>:</div>
<div class="line">        download_images(args.dir)</div>
</div><!-- fragment --><p> When invoking it with the <code>-d image_dir</code> option the images will by downloaded in the <code>image_dir</code> directory. By means of the doxygen configuration parameter <a class="el" href="config.html#cfg_latex_emoji_directory">LATEX_EMOJI_DIRECTORY</a> the requested directory can be selected.</p>
<p>For convenience a zip with the result of running the script can also be downloaded from <a href="../dl/github_emojis.zip">https://www.doxygen.nl/dl/github_emojis.zip</a></p>
<p>For an overview of the supported emoji one can issue the command:<br  />
 <code>doxygen -f emoji &lt;outputFileName&gt;</code></p>
<p> 
Go to the <a href="langhowto.html">next</a> section or return to the
 <a href="index.html">index</a>.
 </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0 </li>
  </ul>
</div>
</body>
</html>
